/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#include "PQException.h"

void throwStringException(char* fmt, ...)
{
	va_list argList;
	va_start(argList, fmt);

	int size = _vsctprintf(fmt, argList);

	std::string msg;
	msg.assign(size+1, _T(' '));
	_vstprintf((char*)&(msg[0]), fmt, argList);
	va_end(argList);

	throw std::exception(msg.c_str());
}
